<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Returns an array representing the font metrics</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="imagick.quantizeimages.html">Imagick::quantizeImages</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="imagick.queryfonts.html">Imagick::queryFonts</a></div>
 <div class="up"><a href="class.imagick.html">Imagick</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="imagick.queryfontmetrics" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Imagick::queryFontMetrics</h1>
  <p class="verinfo">(PECL imagick 2.0.0)</p><p class="refpurpose"><span class="refname">Imagick::queryFontMetrics</span> &mdash; <span class="dc-title">Returns an array representing the font metrics</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-imagick.queryfontmetrics-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">array</span> <span class="methodname"><strong>Imagick::queryFontMetrics</strong></span>
    ( <span class="methodparam"><span class="type"><a href="class.imagickdraw.html" class="type ImagickDraw">ImagickDraw</a></span> <code class="parameter">$properties</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$text</code></span>
   [, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$multiline</code></span>
  ] )</div>

  <p class="para rdfs-comment">
   Returns a multi-dimensional array representing the font metrics.
  </p>
 </div>

 
 <div class="refsect1 parameters" id="refsect1-imagick.queryfontmetrics-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">properties</code></em></dt>

     <dd>

      <p class="para">
       ImagickDraw object containing font properties
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">text</code></em></dt>

     <dd>

      <p class="para">
       The text
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">multiline</code></em></dt>

     <dd>

      <p class="para">
       Multiline parameter. If left empty it is autodetected
      </p>
     </dd>

    
    
   </dl>

  </p>
  
 </div>

 <div class="refsect1 returnvalues" id="refsect1-imagick.queryfontmetrics-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns a multi-dimensional array representing the font metrics.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-imagick.queryfontmetrics-errors">
  <h3 class="title">错误／异常</h3>
  <p class="para">
   错误时抛出 ImagickException。
  </p>
 </div>

 
 <div class="refsect1 examples" id="refsect1-imagick.queryfontmetrics-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-3242">
    <p><strong>Example #1 Using <span class="function"><strong>Imagick::queryFontMetrics()</strong></span>:</strong></p>
    <div class="example-contents"><p>
     Query the metrics for the text and dump the results on the screen.
    </p></div>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/*&nbsp;Create&nbsp;a&nbsp;new&nbsp;Imagick&nbsp;object&nbsp;*/<br /></span><span style="color: #0000BB">$im&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">Imagick</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">/*&nbsp;Create&nbsp;an&nbsp;ImagickDraw&nbsp;object&nbsp;*/<br /></span><span style="color: #0000BB">$draw&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">ImagickDraw</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">/*&nbsp;Set&nbsp;the&nbsp;font&nbsp;*/<br /></span><span style="color: #0000BB">$draw</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setFont</span><span style="color: #007700">(</span><span style="color: #DD0000">'/path/to/font.ttf'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/*&nbsp;Dump&nbsp;the&nbsp;font&nbsp;metrics,&nbsp;autodetect&nbsp;multiline&nbsp;*/<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">queryFontMetrics</span><span style="color: #007700">(</span><span style="color: #0000BB">$draw</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"Hello&nbsp;World!"</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>

 
</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="imagick.quantizeimages.html">Imagick::quantizeImages</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="imagick.queryfonts.html">Imagick::queryFonts</a></div>
 <div class="up"><a href="class.imagick.html">Imagick</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
